﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace DbAdministrator.Controllers
{
    public class AccountController : Controller
    {
        //
        // GET: /Account/

        public ActionResult Login()
        {
            return View();
        }
        [HttpPost]
        public ActionResult Login(string Username, string Password)
        {
            if (Username == "chongshantech" && AesAlgorithm.Encrypt(Password) == 
                AesAlgorithm.Encrypt(System.Configuration.ConfigurationManager.AppSettings["password"]))
            {
                System.Web.Security.FormsAuthentication.SetAuthCookie(Username, false);
                return Redirect("/home/index");
            }
            return RedirectToAction("login");
        }
    }
}
